1. Field of the Invention
The present invention relates to a method to convert a hexadecimal floating point number into a binary floating point number by using a Floating Point Unit with fused multiply-add. Further the invention relates to a Floating Point Unit with fused multiply-add.
2. Background Art
A floating point unit with a fused multiply-add dataflow is described in G. Gerwig et. al. “The IBM eServer z990 floating point unit”, IBM J. Res. & Dev., Vol. 48, No. 3/4, 2004. This floating point unit provides a convert instruction to convert the traditional S/390 HFP (Hex Floating-Point) into BFP (Binary Floating-Point) format according IEEE Standard 754. A good performance is important when results of older existing programs on HFP bases have to exchange data with newer programs on BFP bases. The BFP format is compliant to the IEEE 754 Standard and is more often used in new workloads like C++ and Java.
Floating point numbers are described in the form:
Sign*Base(Exponent)*Mantissa, wherein, more precise, according to the different binary and hexadecimal formats the operands are built up in the hexadecimal HFP format:(−1)SHFP16EHFP−640.Frac56and in the binary BFP format:(−1)SBFP2EBFP−10231.Frac52
The main difference between the formats is the base of the exponent E. It is 16 for HFP and 2 for BFP, which leads to a digit width of four for the HFP and a digit width of one for the BFP fraction.
Also the bias of the exponent is different. HFP uses a power of two (64=2**6), while BFP uses a power of two minus one (1023=2**10−1).
The fraction width is 56 for HFP and 52 for BFP.
Since the number range of BFP operands is higher than HFP operands, the result can be in the overflow or underflow range of the HFP target format. In that case, depending on the rounding mode and mask bits, a maximum number, a minimum number or infinity needs to be forced as output result of a transformation from HFP to BFP.
One example for a convert operation is the TBDR (CONVERT HFP TO BFP−Mnemonic=‘TBDR’) instruction according to z/Architecture Principles of Operation (IBM SA 22-7832). This instruction has several special result requirements for result conditions like ‘Zero Result’, ‘Overflow Condition’ and ‘Underflow Condition’. In these cases the results ‘Maximum Number’, ‘Zero’ and ‘Infinity’ have to be forced.
The state of the art implementation in a Floating Point Units uses the normalizer to detect the result conditions. Since this cannot be done within the normal pipelined operation, every convert instruction is executed in two pipelined cycles.
The logic needed to decide on the special result is too complex, to be done within the running cycle. Also the Condition-Code for these cases cannot be set in time.